<?php
/*
	我的关注
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['lang']){
	$_SESSION['show_lang']=$_RQ['lang'];
}
$this->model('member')->checklogin();
if($_RQ['op']=='main'){
	$return['setting']=$this->plugin_setting('basic');
	$return['list']=array();
	set_html('title','我的关注');
	exi($return);
}
// js 获取数据
if($_RQ['op']=='getlist'){
	$params=array(
		'uniacid'=>$_SESSION['uniacid'],
		'mid'=>$_SESSION['uid'],
	);
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$total='';
	$return['list']=pdo_getslice('jy_weishop_member_like',$params,array($pindex,$psize),$total,'','','id desc');
	foreach($return['list'] as &$item){
		$goods=pdo_get('jy_weishop_goods',array('id'=>$item['goodsid']),array('title','image','marketprice','price'));
		$item=array_merge($goods,$item);
	}
	exi($return);
}
if($_RQ['op']=='del'){
	
	$dels=str_array($_RQ['del']);
	if(!$dels){
		exi('请先选择要删除的项目！','error');
	}
	foreach($dels as $id){
		$id=intval($id);
		if($id){
			pdo_delete('jy_weishop_member_like',array('id'=>$id,'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['mid']));
		}
	}
	exi('删除成功！','','main');
}	